package com.ruoyi.fapiao.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fapiao.mapper.FapiaoInfoMapper;
import com.ruoyi.fapiao.domain.FapiaoInfo;
import com.ruoyi.fapiao.service.IFapiaoInfoService;

/**
 * fapiaoService业务层处理
 * 
 * @author xxxmatata
 * @date 2025-05-19
 */
@Service
public class FapiaoInfoServiceImpl implements IFapiaoInfoService 
{
    @Autowired
    private FapiaoInfoMapper fapiaoInfoMapper;

    /**
     * 查询fapiao
     * 
     * @param fapiaoId fapiao主键
     * @return fapiao
     */
    @Override
    public FapiaoInfo selectFapiaoInfoByFapiaoId(Long fapiaoId)
    {
        return fapiaoInfoMapper.selectFapiaoInfoByFapiaoId(fapiaoId);
    }

    /**
     * 查询fapiao列表
     * 
     * @param fapiaoInfo fapiao
     * @return fapiao
     */
    @Override
    public List<FapiaoInfo> selectFapiaoInfoList(FapiaoInfo fapiaoInfo)
    {
        return fapiaoInfoMapper.selectFapiaoInfoList(fapiaoInfo);
    }

    /**
     * 新增fapiao
     * 
     * @param fapiaoInfo fapiao
     * @return 结果
     */
    @Override
    public int insertFapiaoInfo(FapiaoInfo fapiaoInfo)
    {
        fapiaoInfo.setCreateTime(DateUtils.getNowDate());
        return fapiaoInfoMapper.insertFapiaoInfo(fapiaoInfo);
    }

    /**
     * 修改fapiao
     * 
     * @param fapiaoInfo fapiao
     * @return 结果
     */
    @Override
    public int updateFapiaoInfo(FapiaoInfo fapiaoInfo)
    {
        fapiaoInfo.setUpdateTime(DateUtils.getNowDate());
        return fapiaoInfoMapper.updateFapiaoInfo(fapiaoInfo);
    }

    /**
     * 批量删除fapiao
     * 
     * @param fapiaoIds 需要删除的fapiao主键
     * @return 结果
     */
    @Override
    public int deleteFapiaoInfoByFapiaoIds(Long[] fapiaoIds)
    {
        return fapiaoInfoMapper.deleteFapiaoInfoByFapiaoIds(fapiaoIds);
    }

    /**
     * 删除fapiao信息
     * 
     * @param fapiaoId fapiao主键
     * @return 结果
     */
    @Override
    public int deleteFapiaoInfoByFapiaoId(Long fapiaoId)
    {
        return fapiaoInfoMapper.deleteFapiaoInfoByFapiaoId(fapiaoId);
    }
}
